<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:p="http://primefaces.org/ui"
	xmlns:f="http://java.sun.com/jsf/core">

<h:head>
	<title>祖龙娱乐  - BI系统</title>
	<link href="../../css/component.css" rel="stylesheet" type="text/css" />
	<script type="text/javascript" src="../../js/highcharts.js"></script>
	<script type="text/javascript" src="../../js/drawChart.js"></script>
</h:head>

<h:body>
	<ui:param name="bean" value="#{overviewCountryActionOld}" />
	
	<span class="pagetitle">实时数据 —— 国家概况</span>
	<p:separator />
	
	<!-- 右侧页面顶部查询部分 -->
	<h:form id="fsearch">
		<p:poll interval="100" listener="#{bean.search()}" update=":dform" />
	
		<p:growl id="growl" showDetail="true" sticky="true" />
		<h:outputLabel value="查看日期：" />
        <p:calendar value="#{bean.lookDate}" mode="popup" pattern="yyyy-MM-dd" />
		<h:outputLabel value="（数据更新频率为5分钟）" />&#160;&#160;
        <h:outputLabel value="对比日期：" />
        <p:calendar value="#{bean.compareDate}" mode="popup" pattern="yyyy-MM-dd" />
		&#160;&#160;&#160;

        
        <p:selectOneMenu id="channelSel" styleClass="queryChannel"  style="width:120px;" value="#{bean.queryCountry}">
	        <f:selectItems value="#{bean.countryItmes}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;
        
        <p:selectOneMenu id="serverSel" styleClass="queryServer" value="#{bean.queryServer}">
	         <f:selectItems value="#{bean.serverItmes}" />
        </p:selectOneMenu>
        &#160;&#160;&#160;
		
        <p:commandButton value="查询" action="#{bean.search()}" update=":data" ajax="false" />
	</h:form>
	<br />

	<!-- 数据展示部分，包含表格和图表 -->
	<h:form id="dform">
		<div class="data" id="data">
			<p:panel id="panel1" header="实时数据   #{bean.lastUpdateTimeStr}" style="margin-bottom:10px;">
				<p:dataGrid var="d" columnIndexVar="ci" value="#{bean.datas}" columns="10">
			        <p:panel id="pp#{ci}" header="#{d.title}" style="text-align:center" rendered="#{'激活新增转换率'.equals(d.title) ? false : true}">
			            <h:panelGrid columns="1" style="width:100%" rendered="#{'激活新增转换率'.equals(d.title) ? false : true}">
			                <h:outputText value="#{d.value}" />
			            </h:panelGrid>
			        </p:panel>
                    <p:tooltip id="toolTip#{ci}" for="pp#{ci}" value="#{pageHelper.getToolTip(d.title)}" trackMouse="true" />
			    </p:dataGrid>
		    </p:panel>

            <p:panel id="panel3" header="整体实时在线" style="margin-bottom:10px;">
                    <p:dataGrid id="chart1" var="c" value="#{bean.onlineRealTimeChart}" columns="1" layout="grid">
                    <p:panel style="text-align:center">
                        <h:panelGrid columns="1" style="width:100%">
                            <div id="highchartChart1" style="width:100%;height:400px; border:0;">
                                <script type="text/javascript">
                                    generateChart('#{c.jsonStr}', 'linemore', '1', 'basewidth2');
                                </script>
                            </div>
                        </h:panelGrid>
                    </p:panel>
                </p:dataGrid>
            </p:panel>


            <p:panel id="panel4" header="分小时累计数据" style="margin-bottom:10px;" rendered="true">
                <p:tabView>
                    <p:tab title="新增账号数">
                        <p:dataGrid id="chart8" var="c" value="#{bean.lineChart21}" columns="1" layout="grid">
                            <p:panel style="text-align:center">
                                <h:panelGrid columns="1" style="width:100%">
                                    <div id="highchartChart8" style="width:100%;height:300px; border:0;">
                                        <script type="text/javascript">
                                            generateChart('#{c.jsonStr}', '#{c.jsonType}', '8');
                                        </script>
                                    </div>
                                </h:panelGrid>
                            </p:panel>
                        </p:dataGrid>
                    </p:tab>
                    <p:tab title="去重新增账号数" rendered="false">
                        <p:dataGrid id="chart80" var="c" value="#{bean.lineChart210}" columns="1" layout="grid">
                            <p:panel style="text-align:center">
                                <h:panelGrid columns="1" style="width:100%">
                                    <div id="highchartChart80" style="width:100%;height:300px; border:0;">
                                        <script type="text/javascript">
                                            generateChart('#{c.jsonStr}', '#{c.jsonType}', '80');
                                        </script>
                                    </div>
                                </h:panelGrid>
                            </p:panel>
                        </p:dataGrid>
                    </p:tab>
                    <p:tab title="活跃账号数" rendered="false">
                        <p:dataGrid id="chart9" var="c" value="#{bean.lineChart31}" columns="1" layout="grid">
                            <p:panel style="text-align:center">
                                <h:panelGrid columns="1" style="width:100%">
                                    <div id="highchartChart9" style="width:100%;height:300px; border:0;">
                                        <script type="text/javascript">
                                            generateChart('#{c.jsonStr}', '#{c.jsonType}', '9', "highchartChart8");
                                        </script>
                                    </div>
                                </h:panelGrid>
                            </p:panel>
                        </p:dataGrid>
                    </p:tab>
                    <p:tab title="付费账号数" rendered="false">
                        <p:dataGrid id="chart10" var="c" value="#{bean.lineChart41}" columns="1" layout="grid">
                            <p:panel style="text-align:center">
                                <h:panelGrid columns="1" style="width:100%">
                                    <div id="highchartChart10" style="width:100%;height:300px; border:0;">
                                        <script type="text/javascript">
                                            generateChart('#{c.jsonStr}', '#{c.jsonType}', '10', "highchartChart8");
                                        </script>
                                    </div>
                                </h:panelGrid>
                            </p:panel>
                        </p:dataGrid>
                    </p:tab>
                    <p:tab title="付费金额#{pageHelper.getMoneyType()}">
                        <p:dataGrid id="chart11" var="c" value="#{bean.lineChart51}" columns="1" layout="grid">
                            <p:panel style="text-align:center">
                                <h:panelGrid columns="1" style="width:100%">
                                    <div id="highchartChart11" style="width:100%;height:300px; border:0;">
                                        <script type="text/javascript">
                                            generateChart('#{c.jsonStr}', '#{c.jsonType}', '11', "highchartChart8");
                                        </script>
                                    </div>
                                </h:panelGrid>
                            </p:panel>
                        </p:dataGrid>
                    </p:tab>
                    <p:tab title="新增账号付费人数" rendered="false">
                        <p:dataGrid id="chart12" var="c" value="#{bean.lineChart61}" columns="1" layout="grid">
                            <p:panel style="text-align:center">
                                <h:panelGrid columns="1" style="width:100%">
                                    <div id="highchartChart12" style="width:100%;height:300px; border:0;">
                                        <script type="text/javascript">
                                            generateChart('#{c.jsonStr}', '#{c.jsonType}', '12', "highchartChart8");
                                        </script>
                                    </div>
                                </h:panelGrid>
                            </p:panel>
                        </p:dataGrid>
                    </p:tab>
                    <p:tab title="新增账号付费金额#{pageHelper.getMoneyType()}" rendered="false">
                        <p:dataGrid id="chart13" var="c" value="#{bean.lineChart71}" columns="1" layout="grid">
                            <p:panel style="text-align:center">
                                <h:panelGrid columns="1" style="width:100%">
                                    <div id="highchartChart13" style="width:100%;height:300px; border:0;">
                                        <script type="text/javascript">
                                            generateChart('#{c.jsonStr}', '#{c.jsonType}', '13', "highchartChart8");
                                        </script>
                                    </div>
                                </h:panelGrid>
                            </p:panel>
                        </p:dataGrid>
                    </p:tab>
                </p:tabView>

                <p:accordionPanel activeIndex="100">
                    <p:tab title="点击查看分小时累计详细数据">
                        <p:dataTable var="d" value="#{bean.detailDatas1}" style="margin-top:10px">
                            <p:columnGroup type="header">
                                <p:row>
                                    <p:column rowspan="2" headerText="时间" style="text-align:center" />
                                    <p:column id="aaaaa1" colspan="2" headerText="新增账号数" />
                                    <p:tooltip id="toolTipGrow1" for="aaaaa1" value="新增账号数"  trackMouse="true" />
                                    <p:column id="b1" colspan="2" headerText="累计实时次留"  rendered="false"/>
                                    <p:tooltip id="toolTipGrow2" for="aaaaa1" value="累计分时账号次留" trackMouse="true" rendered="false" />
                                    <p:column colspan="2" headerText="活跃账号数"  rendered="false" />
                                    <p:column colspan="2" headerText="付费账号数" rendered="false" />
                                    <p:column colspan="2" headerText="付费金额#{pageHelper.getMoneyType()}" />
                                    <p:column colspan="2" headerText="新增账号付费人数"  rendered="false" />
                                    <p:column colspan="2" headerText="新增账号付费金额#{pageHelper.getMoneyType()}"  rendered="false" />
                                </p:row>
                                <p:row>
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}" rendered="false" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}" rendered="false"/>
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}"     rendered="false" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}"  rendered="false" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}"     rendered="false" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}"  rendered="false" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}"     rendered="false" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}"  rendered="false" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}"     rendered="false" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}"  rendered="false" />
                                </p:row>
                            </p:columnGroup>

                            <p:column style="text-align:center" >
                                <h:outputText value="#{bean.getHourStr1(d.hour)}" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.newUserLookValue}" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.newUserCompareValue}" />
                            </p:column>
                   <!--         <p:column>
                            	<img src="../../images/pe.png" width="#{bean.getColumnwidth(d.userSecond2LeftHourLookValue,0.2)}"    height="12px" />&#160;
								<h:outputLabel value="#{pageHelper.double2Percent(d.userSecond2LeftHourLookValue)}" />
                            </p:column>
                            <p:column>
                                <img src="../../images/pe.png" width="#{bean.getColumnwidth(d.userSecond2LeftHourCompareValue,0.2)}" height="12px" />&#160;
								<h:outputLabel value="#{pageHelper.double2Percent(d.userSecond2LeftHourCompareValue)}" />
                            </p:column>-->
                            <p:column rendered="false">
                                <h:outputText value="#{d.activeUserLookValue}" />
                            </p:column>
                            <p:column rendered="false">
                                <h:outputText value="#{d.activeUserCompareValue}" />
                            </p:column>
                            <p:column  rendered="false" >
                                <h:outputText value="#{d.payUserLookValue}"/>
                            </p:column>
                            <p:column rendered="false" >
                                <h:outputText value="#{d.payUserCompareValue}" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.payLookValue}" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.payCompareValue}" />
                            </p:column>
                            <p:column rendered="false" >
                                <h:outputText value="#{d.newPayUserLookValue}" />
                            </p:column>
                            <p:column  rendered="false">
                                <h:outputText value="#{d.newPayUserCompareValue}" />
                            </p:column>
                            <p:column  rendered="false">
                                <h:outputText value="#{d.newUserPayLookValue}" />
                            </p:column>
                            <p:column rendered="false">
                                <h:outputText value="#{d.newUserPayCompareValue}"  />
                            </p:column>
                        </p:dataTable>
                    </p:tab>
                </p:accordionPanel>
            </p:panel>


		    <p:panel id="panel2" header="分小时数据" style="margin-bottom:10px;">
		    	<p:tabView>
			        <p:tab title="新增账号数">
			        	<p:dataGrid id="chart2" var="c" value="#{bean.lineChart2}" columns="1" layout="grid">
					        <p:panel style="text-align:center">
					            <h:panelGrid columns="1" style="width:100%">
					                <div id="highchartChart2" style="width:100%;height:300px; border:0;">
										<script type="text/javascript">
											generateChart('#{c.jsonStr}', '#{c.jsonType}', '2');
										</script>  
									</div>
					            </h:panelGrid>
					        </p:panel>
					    </p:dataGrid>
			        </p:tab>
                    <p:tab title="去重新增账号数" rendered="false">
                        <p:dataGrid id="chart20" var="c" value="#{bean.lineChart20}" columns="1" layout="grid">
                            <p:panel style="text-align:center">
                                <h:panelGrid columns="1" style="width:100%">
                                    <div id="highchartChart20" style="width:100%;height:300px; border:0;">
                                        <script type="text/javascript">
                                            generateChart('#{c.jsonStr}', '#{c.jsonType}', '20');
                                        </script>
                                    </div>
                                </h:panelGrid>
                            </p:panel>
                        </p:dataGrid>
                    </p:tab>
			        <p:tab title="活跃账号数" rendered="false">
			        	<p:dataGrid id="chart3" var="c" value="#{bean.lineChart3}" columns="1" layout="grid">
					        <p:panel style="text-align:center">
					            <h:panelGrid columns="1" style="width:100%">
					                <div id="highchartChart3" style="width:100%;height:300px; border:0;">
										<script type="text/javascript">
											generateChart('#{c.jsonStr}', '#{c.jsonType}', '3', "highchartChart2");
										</script>  
									</div>
					            </h:panelGrid>
					        </p:panel>
					    </p:dataGrid>
			        </p:tab>
			        <p:tab title="付费账号数">
			        	<p:dataGrid id="chart4" var="c" value="#{bean.lineChart4}" columns="1" layout="grid">
					        <p:panel style="text-align:center">
					            <h:panelGrid columns="1" style="width:100%">
					                <div id="highchartChart4" style="width:100%;height:300px; border:0;">
										<script type="text/javascript">
											generateChart('#{c.jsonStr}', '#{c.jsonType}', '4', "highchartChart2");
										</script>  
									</div>
					            </h:panelGrid>
					        </p:panel>
					    </p:dataGrid>
			        </p:tab>
			        <p:tab title="付费金额#{pageHelper.getMoneyType()}">
			        	<p:dataGrid id="chart5" var="c" value="#{bean.lineChart5}" columns="1" layout="grid">
					        <p:panel style="text-align:center">
					            <h:panelGrid columns="1" style="width:100%">
					                <div id="highchartChart5" style="width:100%;height:300px; border:0;">
										<script type="text/javascript">
											generateChart('#{c.jsonStr}', '#{c.jsonType}', '5', "highchartChart2");
										</script>  
									</div>
					            </h:panelGrid>
					        </p:panel>
					    </p:dataGrid>
			        </p:tab>
			        <p:tab title="新增账号付费人数">
			        	<p:dataGrid id="chart6" var="c" value="#{bean.lineChart6}" columns="1" layout="grid">
					        <p:panel style="text-align:center">
					            <h:panelGrid columns="1" style="width:100%">
					                <div id="highchartChart6" style="width:100%;height:300px; border:0;">
										<script type="text/javascript">
											generateChart('#{c.jsonStr}', '#{c.jsonType}', '6', "highchartChart2");
										</script>  
									</div>
					            </h:panelGrid>
					        </p:panel>
					    </p:dataGrid>
			        </p:tab>
			        <p:tab title="新增账号付费金额#{pageHelper.getMoneyType()}">
			         	<p:dataGrid id="chart7" var="c" value="#{bean.lineChart7}" columns="1" layout="grid">
					        <p:panel style="text-align:center">
					            <h:panelGrid columns="1" style="width:100%">
					                <div id="highchartChart7" style="width:100%;height:300px; border:0;">
										<script type="text/javascript">
											generateChart('#{c.jsonStr}', '#{c.jsonType}', '7', "highchartChart2");
										</script>  
									</div>
					            </h:panelGrid>
					        </p:panel>
					    </p:dataGrid>
			        </p:tab>
			     </p:tabView>

                <p:accordionPanel activeIndex="0">
                    <p:tab title="点击查看分小时详细数据">
                        <p:dataTable var="d" value="#{bean.detailDatas}" style="margin-top:10px">
                            <p:columnGroup type="header">
                                <p:row>
                                    <p:column rowspan="2" headerText="时间" />

                                    <p:column id="aaaaa" colspan="2" headerText="新增账号数" />
                                    <p:tooltip id="toolTipGrow" for="aaaaa" value="新增账号数" trackMouse="true" />
                                    <p:column colspan="2" headerText="活跃账号数" rendered="false" />
                                    <p:column colspan="2" headerText="付费账号数" />
                                    <p:column colspan="2" headerText="付费金额#{pageHelper.getMoneyType()}" />
                                    <p:column colspan="2" headerText="新增账号付费人数" />
                                    <p:column colspan="2" headerText="新增账号付费金额#{pageHelper.getMoneyType()}" />
                                </p:row>
                                <p:row>
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}" rendered="false" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}"  rendered="false" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.lookDate)}" />
                                    <p:column headerText="#{pageHelper.formatDate(bean.compareDate)}" />
                                </p:row>
                            </p:columnGroup>

                            <p:column>
                                <h:outputText value="#{bean.getHourStr(d.hour)}" />
                            </p:column>

                            <p:column>
                                <h:outputText value="#{d.newUserLookValue}" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.newUserCompareValue}" />
                            </p:column>
                            <p:column rendered="false">
                                <h:outputText value="#{d.activeUserLookValue}"  />
                            </p:column>
                            <p:column rendered="false" >
                                <h:outputText value="#{d.activeUserCompareValue}"  />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.payUserLookValue}" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.payUserCompareValue}" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.payLookValue}" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.payCompareValue}" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.newPayUserLookValue}" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.newPayUserCompareValue}" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.newUserPayLookValue}" />
                            </p:column>
                            <p:column>
                                <h:outputText value="#{d.newUserPayCompareValue}" />
                            </p:column>
                        </p:dataTable>
                    </p:tab>
                </p:accordionPanel>
		    </p:panel>
		</div>
	</h:form>

	<!-- 页脚 -->
	<div class="footer"></div>
</h:body>
</html>
